<?php

/**
 * Formulaire permettant de changer son password 
 */
class Myspace_Form_Password extends Zend_Form {

    /**
     * Initialise le formulaire :
     *  _ pwd 
     */
    public function init() {
        $this->addElementPrefixPath('ZendTremplin_Decorator', 'ZendTremplin/decorator/', 'decorator');

        // Ajout d'un password
        $pwd = new Zend_Form_Element_Password('pwd');
        $pwd->addFilter('StringTrim')
                ->addValidator('StringLength', false, array(3, 10))
                ->setRequired(true)
                ->setLabel('Password')
                ->setAttrib('maxLength', 10)
                ->setDecorators(array('Default'));
        $this->addElement($pwd);

        // Ajout du bouton d'inscription
        $this->addElement('submit', 'submit', array(
            'ignore' => true,
            'label' => 'Change my password',
        ));
    }

}

